Gracefully handle partial git info.#33
Conversation
b911e70 to
677fba5
Compare
|
@cball I'm ok with this change as we still produce a valid version even without the git data and it's probably less confusing for the user instead of getting a weird crash. Maybe we can add a note to the README to stress that some build env might not provide git data? Might be also good to add a warning log message when those properties are null so that if someone uses |
|
@ghedamat 👍 on the note to the README and warning log message, I'll check that out. |
|
Do we have an estimate on when this will get in and published? I'm also getting this error |
|
@seawatts can you confirm that this PR fixes your problem? That would help give it momentum. |
677fba5 to
60076b1
Compare
|
@ghedamat added the requested changes. |
| if (sha) { | ||
| versionString = versionString + '+' + sha; | ||
| } else { | ||
| log('Missing git commit sha, using package version as revisionKey'); |
There was a problem hiding this comment.
@cball could you add { color: 'yellow', verbose: true } here?
@lukemelia this also reminds me that we can set log color for info and danger but not warning levels (it's actually not really a level yet though, so yellow should do for now)
|
@cball added another tiny request, after that will merge Thanks again! |
On some host/git combinations, gitRepoInfo returns an object like the
following:
`{ sha: null, abbreviatedSha: null, branch: 'develop', tag: null }`
When using the version-commit option, ember-cli-deploy would fail if the sha
is empty.
60076b1 to
8c43f50
Compare
|
@ghedamat sure thing! Totally missed that log took additional arguments... should be all set now. |
|
perfect! thanks again! |
|
@cball @seawatts , @lukemelia just released 0.2.2 :) |
|
@ghedamat thanks so much! Check this out! https://greenkeeper.io/ for the win! |
|
Hmm, getting this error now in circle.ci |
|
@seawatts :/ does it work locally for you? we might have just introduced a bug that didn't get caught by the tests.. |
|
@seawatts @ghedamat this is pretty strange, but I've verified the following change in an ssh build works: |
|
@cball, this is definitely a bug. |
|
same here :/ sry @cball |
|
@lukemelia @ghedamat apologies I missed this the first time around. I just opened a PR with the fix mentioned above. On the (slight) plus side I think this would only have broken deploys that would have failed previously for not having an sha present. |
On some host/git combinations (in my case CircleCI), gitRepoInfo seems to return an object like the following:
{ sha: null, abbreviatedSha: null, branch: 'develop', tag: null }When using the version-commit option, ember-cli-deploy fails if the sha is empty. It's not clear to me what the proper behavior should be in this case.
A few options: